<template>
  <div class="community">
    <div class="bar">
      <router-link :class="{'currActive':currName=='WorkView'}" :to="{ name: 'WorkView' }" @click.native="changeCurr('WorkView')">作业</router-link>
      <router-link :class="{'currActive':currName=='QuestionView'}" :to="{ name: 'QuestionView' }" @click.native="changeCurr('QuestionView')">问答</router-link>
      <router-link :class="{'currActive':currName=='ArtWork'}" :to="{ name: 'ArtWork' }" @click.native="changeCurr('ArtWork')">作品</router-link>
      <router-link :class="{'currActive':currName=='PointerView'}" :to="{ name: 'PointerView' }" @click.native="changeCurr('PointerView')">指绘</router-link>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "LqbdemoCommunity",
  data() {
    return {
      currName:'WorkView'
    };
  },
  created() {
   
  },

  mounted() {},

  methods: {
    // console.log(this.$route.name);
    changeCurr(name){
      this.currName=name;
    }
  },
};
</script>

<style lang="scss" scoped>
.currActive{
  color: #089fee;
  position: relative;
  &::after{
    position: absolute;
    content: "";
    width: 25px;
    height: 2px;
    bottom: 0;
    left: 4px;
    background: #089fee;
  }
}
.community{
  position: relative;
  height: 100vh;
  overflow: hidden;
  width: 100vw;
  .bar{
    display: flex;
    justify-content: space-around;
    width: 100vw;
    height: 42px;
    line-height: 42px;
    border-bottom: 1px solid #e6e6e6;
  }
}
</style>
